package com.atstudy.service;

import com.atstudy.dao.AccountDao;
import com.atstudy.entites.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2023/1/31 9:23
 * @copyright: 博为峰
 */
@Service("accountService")
public class AccountServiceImpl implements AccountService {

    @Autowired
    public AccountDao accountDao;

    @Override
    public List<Account> getAccountList() {
        List<Account> accountList = accountDao.selectAccountList();
        return accountList;
    }

    @Override
    public int addAccount() {
        //记录日志

        int i = 0;
        try {
            //前置
            i = accountDao.insertAccount();
            //后置
        } catch (Exception e) {
            e.printStackTrace();
            //异常
        } finally {
            //最终
        }
        return i;
    }

}
